package main;

import java.util.ArrayList;

public class Random {

	
	public static ArrayList<Page> pages = new ArrayList<Page>();
	public static int ARRAY_SIZE = 7;
	
	public static void add(Page page){
	
		if(pages.size() <= ARRAY_SIZE){
			pages.add(page);
		}else{
			remove();
			add(page);
		}
		
	} 
	
	
	public static void remove(){
		
		if(pages.isEmpty()){
		
			System.out.println("queue is already empty");
			
		} else {
			
			int position = (int) (Math.random() * ARRAY_SIZE);
			pages.remove(position);
		}
		
	}
	
}
